package cn.wolfcode.feign;

import cn.wolfcode.common.web.Result;
import cn.wolfcode.domain.UsableIntegral;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient("intergral-service")
@RequestMapping("/intergral")
public interface UsableIntegralFeignApi {

    // 通过用户 id 查询用户积分信息
    @GetMapping("/getByUserId")
    Result<UsableIntegral> getByUserId(@RequestParam Long userId);

    // 支付积分
    @PostMapping("/pay")
    Result<String> pay(@RequestParam Long userId, @RequestParam Long amount);
}
